<!DOCTYpE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head th:replace="_fragments :: head(~{::title})">
		<title>分类页</title>
	</head>
	<body>
		<!--导航-->
		<nav th:replace="_fragments :: menu(2)"></nav>
		
		<!--中间内容-->
		<div class="m-container-small m-padded-tb-big">
			<div class="ui container">
				<!--header-->
				<div class="ui top attached segment">
					<div class="ui middle aligned two column grid">
						<div class="column">
							<h3 class="ui teal header" style="color: #A9BCF5 !important;">分 类</h3>
						</div>
						<div class="right aligned column">
							共  <h2 class="ui orange header m-inline-blok m-text-spaced" th:text="${#arrays.length(types)}">10</h2> 个
						</div>
					</div>
				</div>
				<!--content-->
				<div class="ui attached segment m-padded-tb-large">
					<div class="ui labeled button m-margin-tb-tiny" th:each="type : ${types}">
						<a class="ui basic button" th:classappend="${type.id==activeTypeId} ? 'teal'" th:href="@{/types/{id}(id=${type.id})}" href="#" th:text="${type.name}">思考与感悟</a>
						<div class="ui basic left pointing label" th:classappend="${type.id==activeTypeId} ? 'teal'" th:text="${#arrays.length(type.blogs)}">20</div>
					</div>
					<!--/*-->
					<div class="ui labeled button m-margin-tb-tiny">
						<a class="ui basic button" href="#">Java的艺术</a>
						<div class="ui basic teal left pointing label">20</div>
					</div>
					<div class="ui labeled button m-margin-tb-tiny">
						<a class="ui basic button" href="#">Java的艺术</a>
						<div class="ui basic teal left pointing label">20</div>
					</div>
					<div class="ui labeled button m-margin-tb-tiny">
						<a class="ui basic button" href="#">Java的艺术</a>
						<div class="ui basic teal left pointing label">20</div>
					</div>
					<div class="ui labeled button m-margin-tb-tiny">
						<a class="ui basic button" href="#">Java的艺术</a>
						<div class="ui basic teal left pointing label">20</div>
					</div>
					<div class="ui labeled button m-margin-tb-tiny">
						<a class="ui basic button" href="#">Java的艺术</a>
						<div class="ui basic teal left pointing label">20</div>
					</div>
					<div class="ui labeled button m-margin-tb-tiny">
						<a class="ui basic button" href="#">Java的艺术</a>
						<div class="ui basic teal left pointing label">20</div>
					</div>
					<!--*/-->
				</div>

				<div class="ui top attached teal segment" >
					<div class="ui padded vertical segment m-padded-tb-large" th:each="blog : ${page.content}" th:if="${blog.published}">
						<div class="ui middle aligned  mobile reversed stackable grid" >
							<div class="eleven wide column">
								<h3 class="ui header"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}"  class="m-black" th:text="${blog.title}">你确定以后可以成功吗？</a></h3>
								<p class="m-text" th:text="|${blog.description}...|"></p>
								<div class="ui grid">
									<div class="eleven wide column">
										<div class="ui mini horizontal link list ">
											<div class="item">
												<img src="https://picsum.photos/id/1/100/100" th:src="@{${blog.user.avatar}}" alt="" class="ui avatar image"/>
												<div class="content"><a class="header" href="#" th:href="@{/about}" th:text="${blog.user.nickname}">朱海斌</a></div>
											</div>
											<div class="item">
												<i class="calendar icon"></i> <span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2020-08-07</span>
											</div>
											<div class="item">
												<i class="eye icon"></i> <span th:text="${blog.views}">122</span>
											</div>
										</div>
									</div>
									<div class="right aligned five wide column">
										<a href="#" th:href="@{/types/{id}(id=${blog.type.id})}" class="ui teal basic label m-padded-small m-text-thin" th:text="${blog.type.name}">感想</a>
									</div>
								</div>
							</div>
							<div class="five wide column">
								<a href="#" th:href="@{/blog/{id}(id=${blog.id})}" >
									<img src="https://picsum.photos/id/1/800/450" th:src="@{${blog.firstPicture}}" alt="" class="ui rounded image" />
								</a>
							</div>
						</div>
					</div>

				</div>



				<div class="ui bottom attached segment"  th:if="${page.totalPages}>1">
					<div class="ui middle aligned two column grid">
						<div class="left aligned column">
							<a th:href="@{/(page=${page.number}-1)}"  th:unless="${page.first}" class="ui mini teal basic button">上一页</a>
						</div>
						<div class="right aligned column">
							<a th:href="@{/(page=${page.number}+1)}"  th:unless="${page.last}" class="ui mini teal basic button">下一页</a>
						</div>
					</div>
				</div>
			</div>
		</div>
		<br/>
		<br/>
		<br/>
		<!--底部-->
		<footer th:replace="_fragments :: footer" class="ui inverted vertical segment m-padded-tb-massive"></footer>
		<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
		<script>
			$('.menu.toggle').click(function(){
				$('.m-item').toggleClass('m-mobile-hide');
			});

		</script>
	</body>
</html>
